package com.ml.mall.service.company;

import com.ml.mall.bean.req.company.CompanyRelationAddDto;
import com.ml.mall.bean.req.company.CompanyRelationDelDto;
import com.ml.mall.bean.req.company.CompanyRelationEditDto;
import com.ml.mall.bean.req.company.UCChangeCompanyDto;
import com.ml.mall.entity.company.SysCompany;
import com.ml.mall.entity.company.SysUserCompanyRelation;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ml.mall.entity.sys.SysUser;

import java.util.List;

/**
* <p>
    *  服务类
    * </p>
*
* @author pl
* Created 2021-06-15
*/
public interface SysUserCompanyRelationService extends IService<SysUserCompanyRelation> {

    /**
     * 公司添加新用户操作
     */
    int addUserCompany(CompanyRelationAddDto dto);

    /**
     * @description: 公司删除新用户操作
     * @author kyyang
     * @date 2021/7/24 13:43
     * @version 1.0
     */
    void delUserCompany(CompanyRelationDelDto dto);

    /**
     * @description: 公司查询用户
     * @author kyyang
     * @date 2021/8/14 17:24
     * @version 1.0
     */
    List<SysUserCompanyRelation> getCompanyQueryUser(CompanyRelationAddDto dto);

    /**
     * @description: 公司编辑用户
     * @author kyyang
     * @date 2021/8/21 22:20
     * @version 1.0
     */
    void editUserCompany(CompanyRelationEditDto dto);

    /**
     * 查询当前用户的公司关联信息
     * @return
     */
    List<SysUserCompanyRelation> selfUCRelationQuery();

    /**
     * 更改用户所关联的公司
     * @param dto
     * @return
     */
    boolean changeCompany(UCChangeCompanyDto dto);

    /**
     * 添加用户公司关联信息
     * @param sysUser
     * @param dbCompany
     * @return
     */
    boolean addUCRelation(SysUser sysUser, SysCompany dbCompany);
}
